Field of the Invention
The presently claimed invention is generally related to a managing memory in a multi-processor system. More specifically the presently claimed invention is related to allocating a range of memory addresses to a software process in a computer system.
Description of the Related Art
Conventionally memory that is allocated to a first process running on a computer system must be locked such that another process running on the computer does not overwrite the memory allocated to the first process before the first process has released the lock on the allocated memory. These types of locks are commonly referred to as spin locks. In certain instances when a thread corresponding to process has created a spin lock, the lock may persist longer than the process really needs the spin lock. This is because the period of time that a spin lock is held is not only dependent upon how long a process uses the allocated memory. The period of time that a spin lock is held may also correspond to factors, such as, the number of threads running on the computer system, the architecture and complexity of the memory allocation scheme running at the computer system, and the number of cores in the computer system.
When there are many threads running in a computer system, especially when the computer system includes one or more multi-core processors, the unlocking of memory corresponding to a particular process may be delayed significantly. Delays in releasing spin locks decreases the efficiency of processes running on the computer system. These delays waste the compute cycles in the computer system because a process may have to wait for memory to become available for a thread related to that process to execute code at a processor in the computer system. Current memory allocation schemes, thus, reduce memory allocation efficiency by blocking threads from receiving access to memory quickly after another process has completed using the memory. In certain instances these delays have been known to the system software or a program running on a computer system to abruptly stop functioning (i.e. crash).
What is needed is a system and a method that allows a process to use memory without waiting for a conventional spin lock to be released.